package com.googlecode.wstester

import config.{RequestConfig, TestConfig}
import handlers.TestHandler
import java.util.Properties
import java.io.{File, FileReader}

/**
 * Created by IntelliJ IDEA.
 * User: pablo
 * Date: 2010-06-21
 * Time: 10:48:23
 */

object Main {
  def main(args: Array[String]) {
    var props = new Properties();
    props.load(new FileReader("conf.properties"));
    var dirPrefix = props.getProperty("testDirNamePrefix");
    var exists = true;
    var i = 1;
    while (exists) {
      var testDir = new File(dirPrefix + "" + i);
      i += 1;
      exists = testDir exists;
      if (exists) {
        var tc = new TestConfig(testDir);
        tc.parseConfig
        val th = new TestHandler(tc, testDir.getName);
        th.runTest;
      }
    }
  }
}